// 判断来源app
define(function(require,exports){
    var getUrlParam=require("./getUrlParam").getUrlParam
    var userCode = getUrlParam('userCode') || $('input[name=userCode]').val()
    if (userCode) {
        if (userCode.indexOf('AG') == 0) {
            var isAgentApp = true
        } else {
            var isAgentApp = false
        }
    }

    exports.isAgentApp = isAgentApp

    exports.addFirmCode = function () {
        if (isAgentApp) {
            var firmCode = getUrlParam('firmCode')
            if (firmCode) {
                localStorage.setItem('firmCode', firmCode)
                exports.firmCode = firmCode
            } else {
                exports.firmCode = localStorage.getItem('firmCode')
            }
        }
    }
})